home *** CD-ROM | disk | FTP | other *** search
- Path: rover.ucs.ualberta.ca!alberta!usenet
- From: Ryan Gallagher <ryangall@gpu.srv.ualberta.ca>
- Newsgroups: comp.lang.c
- Subject: Re: The dreaded screen flicker (To graphics programmers)
- Date: 13 Jan 1996 00:56:59 GMT
- Organization: Computing Science, U of Alberta, Edmonton, Canada
- Message-ID: <4d700r$nva@scapa.cs.ualberta.ca>
- References: <DKzBFJ.BC6@eskimo.com>
- NNTP-Posting-Host: assn217.cs.ualberta.ca
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.4 sun4c)
- X-URL: news:DKzBFJ.BC6@eskimo.com
-
- This is definitely not the best solution, but if you are looking for quick
- results, I just finished writing a 3-d object building, and motion program, and
- found that creating a tiny queue for the objects worked quite well for motion.
- It doesnt eliminate 100% of the flicker, but it at least waits till the new
- object is drawn at its new location before erasing the previous one.
-
- Just set a maximum length for the queue...usually 2 (for my stuff) make sure
- you have a int CountQueue(Q) procedure, and Enqueue the new location of the
- object. If CountQueue(Q) exceeds the maximum length, erase the object at the
- the end of the queue and Dequeue(Q); this works pretty good, and you can use it
- for so many other cool things (even though its a pretty cheesie way of doing
- it, it works good enough as far as Im concerned), if you are interested, you
- cancheck for line intersections, and make sure that when you erase at the last
- location in the queue you aren't deleting from the current position. Thats
- pretty easy too, but a bit slower.
-
- anyways....later!
-
-